Fix a blunder in grab handling
authorMatthias Clasen <mclasen@redhat.com>
Tue, 21 Dec 2010 23:42:30 +0000 (18:42 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 21 Dec 2010 23:42:30 +0000 (18:42 -0500)
This was causing segfaults which would go away when compiled with
debug options.

gdk/x11/gdkdisplay-x11.c

index f5f00527fd32dcc23c2500d8a95c6b36e7dcc86a..20405bddc52d3568a6a3bb436ac72636053155fa 100644 (file)
@@ -1588,6 +1588,16 @@ struct XPointerUngrabInfo {
   guint32 time;
 };
 
+static void
+device_grab_update_callback (GdkDisplay *display,
+                             gpointer    data,
+                             gulong      serial)
+{
+  GdkDevice *device = data;
+
+  _gdk_display_device_grab_update (display, device, NULL, serial);
+}
+
 #define XSERVER_TIME_IS_LATER(time1, time2)                        \
   ( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) ||  \
     (( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 ))     \
@@ -1599,9 +1609,7 @@ _gdk_x11_display_update_grab_info (GdkDisplay *display,
                                    gint        status)
 {
   if (status == GrabSuccess)
-    _gdk_x11_roundtrip_async (display,
-                              (GdkRoundTripCallback)_gdk_display_device_grab_update,
-                              device);
+    _gdk_x11_roundtrip_async (display, device_grab_update_callback, device);
 }
 
 void
@@ -1621,9 +1629,7 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
        !XSERVER_TIME_IS_LATER (grab->time, time)))
     {
       grab->serial_end = serial;
-      _gdk_x11_roundtrip_async (display,
-                                (GdkRoundTripCallback)_gdk_display_device_grab_update,
-                                device);
+      _gdk_x11_roundtrip_async (display, device_grab_update_callback, device);
     }
 }